package com.woniu.supermarket.mapper;

import com.woniu.supermarket.entity.Permission;
import com.woniu.supermarket.vo.MenuVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.awt.*;
import java.util.List;

@Repository
public interface PermissionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Permission record);

    Permission selectByPrimaryKey(Integer id);

    List<Permission> selectAll();

    int updateByPrimaryKey(Permission record);

    List<Permission> selectByCons(@Param("name") String name);

    List<MenuVo> selectAllMenu();

    List<Permission> selectParentMenu();

    List<Permission> selectPermissionByRoleId(Integer id);

    List<MenuVo> selectAllPermission();

    List<MenuVo> selectMenuOfSomeone(String username);

    List<String> selectPermissionsOfOne(String username);

    List<String> selectPermissionsForSuperAdmin();

}